return ret;
}
+typedef struct e820entry e820entry_t;
+DEFINE_XEN_GUEST_HANDLE(e820entry_t);
long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
{
break;
}
+ case XENMEM_memory_map:
+ {
+ return -ENOSYS;
+ }
+
+ case XENMEM_machine_memory_map:
+ {
+ struct xen_memory_map memmap;
+ XEN_GUEST_HANDLE(e820entry_t) buffer;
+ int count;
+
+ if ( !IS_PRIV(current->domain) )
+ return -EINVAL;
+
+ if ( copy_from_guest(&memmap, arg, 1) )
+ return -EFAULT;
+ if ( memmap.nr_entries < e820.nr_map + 1 )
+ return -EINVAL;
+
+ buffer = guest_handle_cast(memmap.buffer, e820entry_t);
+
+ count = min((unsigned int)e820.nr_map, memmap.nr_entries);
+ if ( copy_to_guest(buffer, &e820.map[0], count) < 0 )
+ return -EFAULT;
+
+ memmap.nr_entries = count;
+
+ if ( copy_to_guest(arg, &memmap, 1) )
+ return -EFAULT;
+
+ return 0;
+ }
+
default:
return subarch_memory_op(op, arg);
}
typedef struct xen_translate_gpfn_list xen_translate_gpfn_list_t;
DEFINE_XEN_GUEST_HANDLE(xen_translate_gpfn_list_t);
+/*
+ * Returns the pseudo-physical memory map as it was when the domain
+ * was started.
+ */
+#define XENMEM_memory_map 9
+struct xen_memory_map {
+ /*
+ * On call the number of entries which can be stored in buffer. On
+ * return the number of entries which have been stored in
+ * buffer.
+ */
+ unsigned int nr_entries;
+
+ /*
+ * Entries in the buffer are in the same format as returned by the
+ * BIOS INT 0x15 EAX=0xE820 call.
+ */
+ XEN_GUEST_HANDLE(void) buffer;
+};
+typedef struct xen_memory_map xen_memory_map_t;
+DEFINE_XEN_GUEST_HANDLE(xen_memory_map_t);
+
+/*
+ * Returns the real physical memory map. Passes the same structure as
+ * XENMEM_memory_map.
+ */
+#define XENMEM_machine_memory_map 10
+
#endif /* __XEN_PUBLIC_MEMORY_H__ */
/*